/* indent size: 2 */

module.exports = app => {
  const DataTypes = app.Sequelize;

  const Model = app.model.define('loan', {
    id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      primaryKey: true,
      autoIncrement: true,
    },
    num: {
      type: DataTypes.STRING(255),
      allowNull: true,
    },
    borrower: {
      type: DataTypes.STRING(255),
      allowNull: true,
    },
    phone: {
      type: DataTypes.STRING(255),
      allowNull: true,
    },
    entitle: {
      type: DataTypes.STRING(255),
      allowNull: true,
    },
    grade: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
    },
    guarantee: {
      type: DataTypes.STRING(255),
      allowNull: true,
    },
    type: {
      type: DataTypes.STRING(255),
      allowNull: true,
    },
    money: {
      type: 'DOUBLE',
      allowNull: true,
    },
    annual: {
      type: 'DOUBLE',
      allowNull: true,
    },
    repayment: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
    },
    deadline: {
      type: DataTypes.STRING(255),
      allowNull: true,
    },
    created: {
      type: DataTypes.DATE,
      allowNull: true,
    },
    state: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
    },
    way: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
    },
    monthly: {
      type: 'DOUBLE',
      allowNull: true,
    },
    penalty: {
      type: 'DOUBLE',
      allowNull: true,
    },
    purpose: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
    },
    source: {
      type: DataTypes.STRING(255),
      allowNull: true,
    },
    assure: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
    },
    pledge: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
    },
    materials: {
      type: DataTypes.STRING(255),
      allowNull: true,
    },
    datum: {
      type: DataTypes.STRING(255),
      allowNull: true,
    },
    managerfee: {
      type: 'DOUBLE',
      allowNull: true,
    },
    paymoney: {
      type: 'DOUBLE',
      allowNull: true,
    },
    speed: {
      type: 'DOUBLE',
      allowNull: true,
    },
    remarks: {
      type: DataTypes.STRING(255),
      allowNull: true,
    },
    pass: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
    },
  }, {
    tableName: 'loan',
  });

  Model.associate = function() {

  };

  return Model;
};
